var e = require("../../../../../../common/vendor.js"), t = require("../../i18n/index.js"), n = require("../z-paging-interceptor.js"), r = e.initVueI18n(t.messages).t, i = e.index.getSystemInfoSync().language, a = {
    data: function() {
        return {
            language: i
        };
    },
    computed: {
        finalLanguage: function() {
            try {
                var t = e.index.getLocale(), r = this.language;
                return "auto" === t ? n.interceptor._handleLanguage2Local(r, this._language2Local(r)) : t;
            } catch (e) {
                e = VM2_INTERNAL_STATE_DO_NOT_USE_OR_PROGRAM_WILL_FAIL.handleException(e);
                return "zh-Hans";
            }
        },
        finalRefresherDefaultText: function() {
            return this._getI18nText("zp.refresher.default", this.refresherDefaultText);
        },
        finalRefresherPullingText: function() {
            return this._getI18nText("zp.refresher.pulling", this.refresherPullingText);
        },
        finalRefresherRefreshingText: function() {
            return this._getI18nText("zp.refresher.refreshing", this.refresherRefreshingText);
        },
        finalRefresherCompleteText: function() {
            return this._getI18nText("zp.refresher.complete", this.refresherCompleteText);
        },
        finalRefresherUpdateTimeTextMap: function() {
            return {
                title: r("zp.refresherUpdateTime.title"),
                none: r("zp.refresherUpdateTime.none"),
                today: r("zp.refresherUpdateTime.today"),
                yesterday: r("zp.refresherUpdateTime.yesterday")
            };
        },
        finalLoadingMoreDefaultText: function() {
            return this._getI18nText("zp.loadingMore.default", this.loadingMoreDefaultText);
        },
        finalLoadingMoreLoadingText: function() {
            return this._getI18nText("zp.loadingMore.loading", this.loadingMoreLoadingText);
        },
        finalLoadingMoreNoMoreText: function() {
            return this._getI18nText("zp.loadingMore.noMore", this.loadingMoreNoMoreText);
        },
        finalLoadingMoreFailText: function() {
            return this._getI18nText("zp.loadingMore.fail", this.loadingMoreFailText);
        },
        finalEmptyViewText: function() {
            return this.isLoadFailed ? this.finalEmptyViewErrorText : this._getI18nText("zp.emptyView.title", this.emptyViewText);
        },
        finalEmptyViewReloadText: function() {
            return this._getI18nText("zp.emptyView.reload", this.emptyViewReloadText);
        },
        finalEmptyViewErrorText: function() {
            return this.customerEmptyViewErrorText || this._getI18nText("zp.emptyView.error", this.emptyViewErrorText);
        },
        finalSystemLoadingText: function() {
            return this._getI18nText("zp.systemLoading.title", this.systemLoadingText);
        }
    },
    methods: {
        getLanguage: function() {
            return this.finalLanguage;
        },
        _getI18nText: function(e, t) {
            var n = Object.prototype.toString.call(t);
            if ("[object Object]" === n) {
                var i = t[this.finalLanguage];
                if (i) return i;
            } else if ("[object String]" === n) return t;
            return r(e);
        },
        _language2Local: function(e) {
            var t = e.toLowerCase().replace(new RegExp("_", ""), "-");
            return -1 !== t.indexOf("zh") ? "zh" === t || "zh-cn" === t || -1 !== t.indexOf("zh-hans") ? "zh-Hans" : "zh-Hant" : -1 !== t.indexOf("en") ? "en" : e;
        }
    }
};

exports.i18nModule = a;